package com.itheima;

public class Demo03ArrayMax {
    public static void main(String[] args) {
        int[] array = {5, 30, 40, 15};
        int max = array[0];
        for (int i = 1; i < array.length; i++) {
            if (array[i] > max) {
                max = array[i];
            }

        }
        System.out.println(max);
    }
}
